package cease.command;

import java.io.ByteArrayOutputStream;

import org.kohsuke.args4j.CmdLineParser;

/**
 * @author dhf
 */
public abstract class HasOptionCommand implements Command {
    protected CmdLineParser parser = new CmdLineParser(this);

    private String optDesc = null;

    public String getOptDesc() {
        if (null == optDesc) {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            parser.printUsage(baos);
            optDesc = baos.toString();
        }
        return optDesc;
    }
}
